# -*- coding: utf-8 -*-
N,e,D = raw_input().strip().split(' ')
N=int(N)
e=float(e)
D=int(D)
#print N,e,D
i=1
maybeempty=0
isempty=0
while i<=N:
    ins = raw_input().strip().split(' ')
    K = int(ins[0])
    es = map(float, ins[1:])
    count = 0
    for t in es:
        if t<e:
            count+=1
    if count*2 > K:
        if K>D:
            isempty+=1
        else:
            maybeempty+=1
    i+=1

print '%.1f'%(100.0*maybeempty/N)+'% '+'%.1f'%(100.0*isempty/N)+'%'